package me.weijing.common.util;

import me.weijing.common.CommonApplication;
import me.weijing.common.R;
import android.content.Context;

public class URLUtil {
    public static String loadHttpUrl(Context context) {
        String server_dns = "";
        switch (Integer.valueOf(context.getString(R.string.environment_tip))) {
        case CommonApplication.LOCAL_HTTP_URL:
            server_dns = context.getString(R.string.develop_dns);
            break;
        case CommonApplication.SERVER_HTTP_URL:
            server_dns = context.getString(R.string.server_dns);
            break;
        }
        return server_dns;
    }

    public static String loadOpenfireUrl(Context context) {
        String openfireUrl = "";
        switch (Integer.valueOf(context.getString(R.string.environment_tip))) {
        case CommonApplication.LOCAL_OPENFIRE_URL:
            openfireUrl = context.getString(R.string.url_xmpp_domain_develop);
            break;
        case CommonApplication.SERVER_OPENFIRE_URL:
            openfireUrl = context.getString(R.string.url_xmpp_domain_produce);
            break;
        }
        return openfireUrl;
    }

    public static String loadOpenfireDomain(Context context) {
        String openfireDomain = "";
        switch (Integer.valueOf(context.getString(R.string.environment_tip))) {
        case CommonApplication.LOCAL_OPENFIRE_DOMAIN:
            openfireDomain = context.getString(R.string.xmpp_domain_develop);
            break;
        case CommonApplication.SERVER_OPENFIRE_DOMAIN:
            openfireDomain = context.getString(R.string.xmpp_domain_produce);
            break;
        }
        return openfireDomain;
    }

    public static String loadMapPolice(Context context) {
        String map_key = "";
        switch (Integer.valueOf(context.getString(R.string.environment_tip))) {
        case CommonApplication.LOCAL_MAP_POLICE:
            map_key = context.getString(R.string.bd_map_key_police_develop);
            break;
        case CommonApplication.SERVER_MAP_PEOPLE:
            map_key = context.getString(R.string.bd_map_key_police_produce);
            break;
        }
        return map_key;
    }

    public static String loadMapPeople(Context context) {
        String map_key = "";
        switch (Integer.valueOf(context.getString(R.string.environment_tip))) {
        case CommonApplication.LOCAL_MAP_PEOPLE:
            map_key = context.getString(R.string.bd_map_key_people_develop);
            break;
        case CommonApplication.SERVER_MAP_PEOPLE:
            map_key = context.getString(R.string.bd_map_key_people_produce);
            break;
        }
        return map_key;
    }

}
